;(function(){
	$$.data.Synchronizer = function(){
		/**
		 * 生成上一条记录，下一条记录功能
		 * @param {String} tableName 表名。
		 * @param {Number} opt opt有两个值，0或1.
		 * @return {String}
		 */
	    this.between = function(tableName, opt) {
			var 
				 html 	= '<a href="?ID={0}">{1}</a>'
				,ID 	= Number(Request.QueryString('ID')())
				,sql 	= opt
						? "SELECT ID, title FROM {0} WHERE ID < {1} ORDER BY ID DESC"
						: "SELECT ID, title FROM {0} WHERE ID > {1} ORDER BY ID"
				,sql 	= sql.format(tableName, ID);
	
			with (this.constructor(sql).rsObj) {
				html = EOF ? (opt ? "下面没有记录。" : "此为第一条记录。") : html.format(
						fields("ID").value, fields("title").value);
				Close();
			}
			return html;
		}
		// 计数器
		this.readHits = function(table){
			var 
				 sql	  = "UPDATE {0} SET ReadHits = ReadHits + 1 WHERE ID = {1}".format(table, Request('ID')())
				,sql	  = this.constructor(sql)
				,sql	  = "SELECT ReadHits FROM {0} WHERE ID = {1}".format(table, Request('ID')())
				,sql 	  = this.constructor(sql).rsObj
				,readHits = sql('readHits').value;
			
			sql.close();
			return readHits;
		}
	}
})();